<?php
/**
 * Created by gjk7788@163.com.
 * User: Carl
 * Date: 2018/6/22
 * Time: 10:57
 */

namespace App\Inspections;


use Mockery\Exception;

class KeyHeldDown
{
    public function detect($body)
    {
        if (preg_match('/(.)\\1{4,}/', $body)) {
            throw new Exception('Your reply contains spam.');
        }
    }
}